﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FigureDraw.Shapes.Effect
{
    public class MyShadow : MyEffect
    {
        public MyShadow()
        {
        }

        public MyShadow(MyShape shape)
            : base(shape)
        {
        }

        public override MyShape Clone()
        {
            return new MyShadow(originalShape);
        }

        public override void Draw(Graphic.CommonGraphic graphic)
        {
            MyShape shadow = originalShape.Clone();

            shadow.StrokeColor = new MyColorInfo(50, 50, 50);
            shadow.BrushColor = new MyColorInfo(50, 50, 50);
            shadow.StartPoint = new MyPoint(shadow.StartPoint.X + 10, shadow.StartPoint.Y + 5);
            shadow.EndPoint = new MyPoint(shadow.EndPoint.X + 10, shadow.EndPoint.Y + 5);

            shadow.Draw(graphic);

            originalShape.StrokeColor = strokeColor;
            originalShape.BrushColor = BrushColor;
            originalShape.StrokeWidth = strokeWidth;
            originalShape.StartPoint = startPoint;
            originalShape.EndPoint = endPoint;
            base.Draw(graphic);
        }

        public override MyShape AttachEffect(MyShape shape)
        {
            return new MyShadow(shape);
        }

        public override MyShape DetachEffect()
        {
            return originalShape;
        }
    }
}
